using Admin.NET.Core;
using MOKA.TPM.Entity;
using System.ComponentModel.DataAnnotations;

namespace MOKA.TPM.Service.Dto;

/// <summary>
/// 页面输出参数 （点检记录详情）
/// </summary>
public class CheckupDetailOutput : CheckupDetail
{
    /// <summary>
    /// 点检人 （字典或人员名称）
    /// </summary>
    public string? ItemFinishManName { get; set; }

    /// <summary>
    /// 点检结果 （字典名称）
    /// </summary>
    public string? ItemCheckupResultName { get; set; }

    /// <summary>
    /// 处理结果 （字典名称）
    /// </summary>
    public string? SolveResultName { get; set; }

    /// <summary>
    /// 处理人 （字典或人员名称）
    /// </summary>
    public string? SolveManName { get; set; }

    /// <summary>
    /// 主表实体
    /// </summary>
    public Checkup Checkup { get; set; }

    /// <summary>
    /// 关联对象等
    /// </summary>
    //public string? WePartyLevelName { get; set; }
}

/// <summary>
/// 单ID查询参数
/// </summary>
public class CheckupDetailInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid? Id { get; set; }

    /// <summary>
    /// 点检号
    /// </summary>
    public Guid? CheckupId { get; set; }  //唯一索引

    /// <summary>
    /// 点检项
    /// </summary>
    public Guid? CheckupItemId { get; set; }  //唯一索引
}

/// <summary>
/// 普通查询参数
/// </summary>
public class GetCheckupDetailInput : BaseOrderInput
{
    /// <summary>
    /// 点检号
    /// </summary>
    public Guid? CheckupId { get; set; }  //唯一索引

    /// <summary>
    /// 点检项
    /// </summary>
    public Guid? CheckupItemId { get; set; }  //唯一索引
}

/// <summary>
/// 分页查询参数
/// </summary>
public class PageCheckupDetailInput : BasePageInput
{
    /// <summary>
    /// 点检号
    /// </summary>
    public Guid? CheckupId { get; set; }  //唯一索引

    /// <summary>
    /// 点检项
    /// </summary>
    public Guid? CheckupItemId { get; set; }  //唯一索引
}

/// <summary>
/// 新增记录参数
/// </summary>
public class AddCheckupDetailInput
{
    /// <summary>
    /// 点检号
    /// </summary>
    public Guid CheckupId { get; set; }

    /// <summary>
    /// 点检项
    /// </summary>
    public Guid CheckupItemId { get; set; }

    /// <summary>
    /// 点检人
    /// </summary>
    [Required, MaxLength(20)]
    public string ItemFinishMan { get; set; } = string.Empty;

    /// <summary>
    /// 点检日期
    /// </summary>
    public DateTime ItemFinishTime { get; set; }

    /// <summary>
    /// 参数值
    /// </summary>
    public decimal? IteParamValue { get; set; }

    /// <summary>
    /// 点检结果
    /// </summary>
    public Guid ItemCheckupResult { get; set; }

    /// <summary>
    /// 异常描述
    /// </summary>
    [MaxLength(200)]
    public string? ExceptionDesc { get; set; }

    /// <summary>
    /// 异常原因
    /// </summary>
    [MaxLength(200)]
    public string? Reason { get; set; }

    /// <summary>
    /// 解决方法
    /// </summary>
    [MaxLength(200)]
    public string? Solution { get; set; }

    /// <summary>
    /// 更换配件号
    /// </summary>
    public Guid? PartId { get; set; }

    /// <summary>
    /// 更换配件数量
    /// </summary>
    public int? PartCount { get; set; }

    /// <summary>
    /// 处理结果
    /// </summary>
    public Guid? SolveResult { get; set; }

    /// <summary>
    /// 处理人
    /// </summary>
    [MaxLength(20)]
    public string? SolveMan { get; set; }

    /// <summary>
    /// 处理时间
    /// </summary>
    public DateTime? SolveTime { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }
}

/// <summary>
/// 更新参数
/// </summary>
public class UpdateCheckupDetailInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 点检号
    /// </summary>
    public Guid CheckupId { get; set; }

    /// <summary>
    /// 点检项
    /// </summary>
    public Guid CheckupItemId { get; set; }

    /// <summary>
    /// 点检人
    /// </summary>
    [MaxLength(20)]
    public string ItemFinishMan { get; set; }

    /// <summary>
    /// 点检日期
    /// </summary>
    public DateTime ItemFinishTime { get; set; }

    /// <summary>
    /// 参数值
    /// </summary>
    public decimal? IteParamValue { get; set; }

    /// <summary>
    /// 点检结果
    /// </summary>
    public Guid ItemCheckupResult { get; set; }

    /// <summary>
    /// 异常描述
    /// </summary>
    [MaxLength(200)]
    public string? ExceptionDesc { get; set; }

    /// <summary>
    /// 异常原因
    /// </summary>
    [MaxLength(200)]
    public string? Reason { get; set; }

    /// <summary>
    /// 解决方法
    /// </summary>
    [MaxLength(200)]
    public string? Solution { get; set; }

    /// <summary>
    /// 更换配件号
    /// </summary>
    public Guid? PartId { get; set; }

    /// <summary>
    /// 更换配件数量
    /// </summary>
    public int? PartCount { get; set; }

    /// <summary>
    /// 处理结果
    /// </summary>
    public Guid? SolveResult { get; set; }

    /// <summary>
    /// 处理人
    /// </summary>
    [MaxLength(20)]
    public string? SolveMan { get; set; }

    /// <summary>
    /// 处理时间
    /// </summary>
    public DateTime? SolveTime { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(200)]
    public string? Remark { get; set; }
}

/// <summary>
/// 删除参数
/// </summary>
public class DeleteCheckupDetailInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }
}

/// <summary>
/// 更新部分数据参数
/// </summary>
public class UpdateSomeCheckupDetailInput
{
    /// <summary>
    /// 序号
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 点检号
    /// </summary>
    public string? CheckupId { get; set; }  //唯一索引

    /// <summary>
    /// 点检项
    /// </summary>
    public string? CheckupItemId { get; set; }  //唯一索引
}